﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Weazel.Willows.Model
{
	public partial class SignalReaderInterface
		: ChannelReaderInterface, ISignal
	{
		private ISignal attachedSignal;
		public ISignal AttachedSignal
		{
			get { return attachedSignal; }
			set { attachedSignal = value; }
		}

		public override Module GetWritingDatapath()
		{			
			throw new NotImplementedException();
		}

		public void SetReadingDatapath(Module module)
		{
		}

		public SignalReaderInterface(Module parent, Signal signal, string uniqueName)
			: base(parent, signal.TypeRegistry, signal.Type, signal.LocalName, uniqueName)
		{
			this.attachedSignal = signal;
			signal.BindOutput(this);
		}

		public SignalReaderInterface(Module parent, SignalInConnector connector, string uniqueName)
			: base(parent, connector.TypeRegistry, connector.Type, connector.LocalName, uniqueName)
		{
			this.attachedSignal = connector;
			connector.BindOutput(this);
		}

		public SignalReaderInterface(Module parent, TypeRegistry typeRegistry, Type type, string name, string uniqueName)
			: base(parent, typeRegistry, type, name, uniqueName)
		{
		}
	}
}
